package cn.itcalvin.sncoal.cth.datasource;

import cn.itcalvin.sncoal.cth.component.ConfigCacheUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ApplicationStartupListener implements ApplicationListener<ApplicationReadyEvent> {

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        log.info("启动完成------开始加载考核指标到内存");
        ConfigCacheUtils.getInstance().initCache();
        log.info("启动完成------完成加载考核指标到内存");
    }
}